package com.longxi.tianjintianbao.ui.adapter.multitype.approval;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.listener.AdapterListener;
import com.longxi.tianjintianbao.model.approval.Approval;
import com.longxi.tianjintianbao.utils.MyUtils;

import me.drakeet.multitype.ItemViewBinder;

/**
 * Created by cxw on 2018/2/20.
 */
public class ApprovalNoTopViewBinder extends ItemViewBinder<Approval, ApprovalNoTopViewBinder.ViewHolder> {

    AdapterListener listener;

    public ApprovalNoTopViewBinder(AdapterListener listener) {
        this.listener = listener;
    }

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.include_approval_content, parent, false);
        return new ViewHolder(root);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull Approval approval2) {
        holder.mRlBtn.setBackgroundColor(MyUtils.getResource().getColor(R.color.white));
        holder.tvName.setText("申请人:" + approval2.getApplyer());
//        holder.tvAddress.setText("会签单号:" + approval2.getSigncode());
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        RelativeLayout mRlBtn;
        TextView tvName;
        TextView tvAddress;
        ViewHolder(View itemView) {
            super(itemView);
            mRlBtn = itemView.findViewById(R.id.rlBtn);
            tvName = itemView.findViewById(R.id.tvName);
            tvAddress = itemView.findViewById(R.id.tvAddress);
        }
    }
}
